const { Menu, app } = require("electron/main");
const funcName = "click-menu-item";
const list = [
    {
        label: "窗口",
        submenu: [
            {
                label: "新建窗口",
                accelerator: "CmdOrCtrl+shift+N",
                click: () => {
                    app.emit(funcName, "CmdOrCtrl+shift+N");
                },
            },
            {
                type: "separator",
            },
            {
                label: "关闭窗口",
                accelerator: "CmdOrCtrl+shift+W",
                click: () => {
                    app.emit(funcName, "CmdOrCtrl+shift+W");
                },
            },
        ],
    },
    {
        label: "文件",
        submenu: [
            {
                label: "打开文件",
                accelerator: "CmdOrCtrl+O",
                click: () => {
                    app.emit(funcName, "CmdOrCtrl+O");
                },
            },
        ],
    },
];
const menus = Menu.buildFromTemplate(list);
// Menu.setApplicationMenu(menus);
module.exports = menus;
